import Vue from 'vue'
import VueRouter from 'vue-router'
import Index from '../views/index.vue'

//路由有bug，需要重写push方法
const routerPush = VueRouter.prototype.push
VueRouter.prototype.push = function push(location) {
  return routerPush.call(this, location).catch(error=> error);
};

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Index",
    component: Index
  }
];

const router = new VueRouter({
  routes
})

export default router
